/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * JRTC
 * 低延迟音视频通信服务
 *
 * OpenAPI spec version: v1
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using JDCloudSDK.Core.Auth;
using JDCloudSDK.Core.Client;
using JDCloudSDK.Core.Http;
using JDCloudSDK.Openjrtc.Apis;
using JDCloudSDK.Openjrtc.Model;
using System;
using System.Collections.Generic;
using System.Text;
#if NET40||NET35
#else
using System.Threading.Tasks;
#endif

namespace JDCloudSDK.Openjrtc.Client
{
    /// <summary>
    ///  JRTC
    ///  低延迟音视频通信服务
    ///  Openjrtc Api 客户端
    ///</summary>
    public class OpenjrtcClient : JdcloudClient
    {

        /// <summary>
        ///  默认私有构造函数
        /// </summary>
        private OpenjrtcClient()
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="environment">sdk 环境配置信息</param>
        public OpenjrtcClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig,SDKEnvironment environment)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
            this.environment = environment;
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="credentialsProvider">认证信息</param>
        public OpenjrtcClient(CredentialsProvider credentialsProvider,HttpRequestConfig httpRequestConfig)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        /// 默认构造函数，
        /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        public OpenjrtcClient(CredentialsProvider credentialsProvider)
        {
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        ///  版本号 1.2.8
        ///</summary>
        public const string ClientVersion = "1.2.8";

        private const string apiVersion = "v1";
        private const string userAgentPrefix = "JdcloudSdkDotNet";
        private const string defaultEndpoint = "openjrtc.jdcloud-api.com";
        private const string serviceName = "openjrtc";
        private const string userAgent = userAgentPrefix + "/" + ClientVersion + " " + serviceName + "/" + apiVersion;


        private SDKEnvironment environment = new SDKEnvironment(defaultEndpoint);
        private CredentialsProvider credentialsProvider;
        private HttpRequestConfig httpRequestConfig;

        /// <summary>
        ///  获取证书信息
        ///</summary>
        public override CredentialsProvider CredentialsProvider   { get { return credentialsProvider; } }

        /// <summary>
        ///  获取http 客户端配置信息
        ///</summary>
        public override HttpRequestConfig HttpRequestConfig { get { return httpRequestConfig; } }

        /// <summary>
        ///  获取sdk环境配置信息
        ///</summary>
        public override SDKEnvironment SDKEnvironment { get { return environment; } }

        /// <summary>
        ///  获取用户自定义浏览器识别字符串
        ///</summary>
        public override string UserAgent { get { return userAgent; } }

        /// <summary>
        ///  获取服务名称
        ///</summary>
        public override string ServiceName { get { return serviceName; } }

        /// <summary>
        ///  获取版本号
        ///</summary>
        public override string Version { get { return apiVersion; } }



#if NET40||NET35
        /// <summary>
        ///  查询应用下的房间列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - appId[eq] 按应用ID查询
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeRoomsResponse DescribeRooms(DescribeRoomsRequest request) {
            return  new DescribeRoomsExecutor().Client(this).Execute<DescribeRoomsResponse, DescribeRoomsResult, DescribeRoomsRequest>(request);
        }
#else
        /// <summary>
        ///  查询应用下的房间列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - appId[eq] 按应用ID查询
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeRoomsResponse> DescribeRooms(DescribeRoomsRequest request) {
            return await new DescribeRoomsExecutor().Client(this).Execute<DescribeRoomsResponse, DescribeRoomsResult, DescribeRoomsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询房间内人员列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - status[eq] 在线状态 1-在线 2-离线
        ///            - startTime[eq] 用户加入时间段开始时间-UTC时间  startTime,endTime同时有值时生效
        ///            - endTime[eq] 用户加入时间段结束时间-UTC时间    startTime,endTime同时有值时生效
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeRoomUsersResponse DescribeRoomUsers(DescribeRoomUsersRequest request) {
            return  new DescribeRoomUsersExecutor().Client(this).Execute<DescribeRoomUsersResponse, DescribeRoomUsersResult, DescribeRoomUsersRequest>(request);
        }
#else
        /// <summary>
        ///  查询房间内人员列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - status[eq] 在线状态 1-在线 2-离线
        ///            - startTime[eq] 用户加入时间段开始时间-UTC时间  startTime,endTime同时有值时生效
        ///            - endTime[eq] 用户加入时间段结束时间-UTC时间    startTime,endTime同时有值时生效
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeRoomUsersResponse> DescribeRoomUsers(DescribeRoomUsersRequest request) {
            return await new DescribeRoomUsersExecutor().Client(this).Execute<DescribeRoomUsersResponse, DescribeRoomUsersResult, DescribeRoomUsersRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  下发混流任务
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public StartMcuTranscodeResponse StartMcuTranscode(StartMcuTranscodeRequest request) {
            return  new StartMcuTranscodeExecutor().Client(this).Execute<StartMcuTranscodeResponse, StartMcuTranscodeResult, StartMcuTranscodeRequest>(request);
        }
#else
        /// <summary>
        ///  下发混流任务
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<StartMcuTranscodeResponse> StartMcuTranscode(StartMcuTranscodeRequest request) {
            return await new StartMcuTranscodeExecutor().Client(this).Execute<StartMcuTranscodeResponse, StartMcuTranscodeResult, StartMcuTranscodeRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  统计房间内人数
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeRoomUsersNumResponse DescribeRoomUsersNum(DescribeRoomUsersNumRequest request) {
            return  new DescribeRoomUsersNumExecutor().Client(this).Execute<DescribeRoomUsersNumResponse, DescribeRoomUsersNumResult, DescribeRoomUsersNumRequest>(request);
        }
#else
        /// <summary>
        ///  统计房间内人数
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeRoomUsersNumResponse> DescribeRoomUsersNum(DescribeRoomUsersNumRequest request) {
            return await new DescribeRoomUsersNumExecutor().Client(this).Execute<DescribeRoomUsersNumResponse, DescribeRoomUsersNumResult, DescribeRoomUsersNumRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateRoomResponse CreateRoom(CreateRoomRequest request) {
            return  new CreateRoomExecutor().Client(this).Execute<CreateRoomResponse, CreateRoomResult, CreateRoomRequest>(request);
        }
#else
        /// <summary>
        ///  创建房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateRoomResponse> CreateRoom(CreateRoomRequest request) {
            return await new CreateRoomExecutor().Client(this).Execute<CreateRoomResponse, CreateRoomResult, CreateRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询注册用户
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeRegisterUserResponse DescribeRegisterUser(DescribeRegisterUserRequest request) {
            return  new DescribeRegisterUserExecutor().Client(this).Execute<DescribeRegisterUserResponse, DescribeRegisterUserResult, DescribeRegisterUserRequest>(request);
        }
#else
        /// <summary>
        ///  查询注册用户
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeRegisterUserResponse> DescribeRegisterUser(DescribeRegisterUserRequest request) {
            return await new DescribeRegisterUserExecutor().Client(this).Execute<DescribeRegisterUserResponse, DescribeRegisterUserResult, DescribeRegisterUserRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateUserRoomResponse UpdateUserRoom(UpdateUserRoomRequest request) {
            return  new UpdateUserRoomExecutor().Client(this).Execute<UpdateUserRoomResponse, UpdateUserRoomResult, UpdateUserRoomRequest>(request);
        }
#else
        /// <summary>
        ///  修改房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateUserRoomResponse> UpdateUserRoom(UpdateUserRoomRequest request) {
            return await new UpdateUserRoomExecutor().Client(this).Execute<UpdateUserRoomResponse, UpdateUserRoomResult, UpdateUserRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  添加录制规则
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AddRecordRuleResponse AddRecordRule(AddRecordRuleRequest request) {
            return  new AddRecordRuleExecutor().Client(this).Execute<AddRecordRuleResponse, AddRecordRuleResult, AddRecordRuleRequest>(request);
        }
#else
        /// <summary>
        ///  添加录制规则
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AddRecordRuleResponse> AddRecordRule(AddRecordRuleRequest request) {
            return await new AddRecordRuleExecutor().Client(this).Execute<AddRecordRuleResponse, AddRecordRuleResult, AddRecordRuleRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询注册房间号列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - startTime[eq] 房间注册时间段开始时间-UTC时间 startTime,endTime同时有值时生效
        ///            - endTime[eq] 房间注册时间段结束时间-UTC时间   startTime,endTime同时有值时生效
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeUserRoomsResponse DescribeUserRooms(DescribeUserRoomsRequest request) {
            return  new DescribeUserRoomsExecutor().Client(this).Execute<DescribeUserRoomsResponse, DescribeUserRoomsResult, DescribeUserRoomsRequest>(request);
        }
#else
        /// <summary>
        ///  查询注册房间号列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - startTime[eq] 房间注册时间段开始时间-UTC时间 startTime,endTime同时有值时生效
        ///            - endTime[eq] 房间注册时间段结束时间-UTC时间   startTime,endTime同时有值时生效
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeUserRoomsResponse> DescribeUserRooms(DescribeUserRoomsRequest request) {
            return await new DescribeUserRoomsExecutor().Client(this).Execute<DescribeUserRoomsResponse, DescribeUserRoomsResult, DescribeUserRoomsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询应用appKey
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAppKeyResponse DescribeAppKey(DescribeAppKeyRequest request) {
            return  new DescribeAppKeyExecutor().Client(this).Execute<DescribeAppKeyResponse, DescribeAppKeyResult, DescribeAppKeyRequest>(request);
        }
#else
        /// <summary>
        ///  查询应用appKey
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAppKeyResponse> DescribeAppKey(DescribeAppKeyRequest request) {
            return await new DescribeAppKeyExecutor().Client(this).Execute<DescribeAppKeyResponse, DescribeAppKeyResult, DescribeAppKeyRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  发送自定义信令给房间内的人员
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public SendMessageToUserResponse SendMessageToUser(SendMessageToUserRequest request) {
            return  new SendMessageToUserExecutor().Client(this).Execute<SendMessageToUserResponse, SendMessageToUserResult, SendMessageToUserRequest>(request);
        }
#else
        /// <summary>
        ///  发送自定义信令给房间内的人员
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<SendMessageToUserResponse> SendMessageToUser(SendMessageToUserRequest request) {
            return await new SendMessageToUserExecutor().Client(this).Execute<SendMessageToUserResponse, SendMessageToUserResult, SendMessageToUserRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateRoomResponse UpdateRoom(UpdateRoomRequest request) {
            return  new UpdateRoomExecutor().Client(this).Execute<UpdateRoomResponse, UpdateRoomResult, UpdateRoomRequest>(request);
        }
#else
        /// <summary>
        ///  修改房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateRoomResponse> UpdateRoom(UpdateRoomRequest request) {
            return await new UpdateRoomExecutor().Client(this).Execute<UpdateRoomResponse, UpdateRoomResult, UpdateRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  生成token-用户加入房间时携带token校验通过后方能加入
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateTokenResponse CreateToken(CreateTokenRequest request) {
            return  new CreateTokenExecutor().Client(this).Execute<CreateTokenResponse, CreateTokenResult, CreateTokenRequest>(request);
        }
#else
        /// <summary>
        ///  生成token-用户加入房间时携带token校验通过后方能加入
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateTokenResponse> CreateToken(CreateTokenRequest request) {
            return await new CreateTokenExecutor().Client(this).Execute<CreateTokenResponse, CreateTokenResult, CreateTokenRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  注册用户房间号-将业务接入方定义的userRoomId注册为jrtc系统内可识别和流转的房间号
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RegisterUserRoomResponse RegisterUserRoom(RegisterUserRoomRequest request) {
            return  new RegisterUserRoomExecutor().Client(this).Execute<RegisterUserRoomResponse, RegisterUserRoomResult, RegisterUserRoomRequest>(request);
        }
#else
        /// <summary>
        ///  注册用户房间号-将业务接入方定义的userRoomId注册为jrtc系统内可识别和流转的房间号
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RegisterUserRoomResponse> RegisterUserRoom(RegisterUserRoomRequest request) {
            return await new RegisterUserRoomExecutor().Client(this).Execute<RegisterUserRoomResponse, RegisterUserRoomResult, RegisterUserRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  注册用户-将业务接入方用户体系的userId注册为jrtc系统内可识别和流转的用户id
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RegisterUserResponse RegisterUser(RegisterUserRequest request) {
            return  new RegisterUserExecutor().Client(this).Execute<RegisterUserResponse, RegisterUserResult, RegisterUserRequest>(request);
        }
#else
        /// <summary>
        ///  注册用户-将业务接入方用户体系的userId注册为jrtc系统内可识别和流转的用户id
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RegisterUserResponse> RegisterUser(RegisterUserRequest request) {
            return await new RegisterUserExecutor().Client(this).Execute<RegisterUserResponse, RegisterUserResult, RegisterUserRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  关闭房间内的指定流
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CloseRoomUserStreamResponse CloseRoomUserStream(CloseRoomUserStreamRequest request) {
            return  new CloseRoomUserStreamExecutor().Client(this).Execute<CloseRoomUserStreamResponse, CloseRoomUserStreamResult, CloseRoomUserStreamRequest>(request);
        }
#else
        /// <summary>
        ///  关闭房间内的指定流
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CloseRoomUserStreamResponse> CloseRoomUserStream(CloseRoomUserStreamRequest request) {
            return await new CloseRoomUserStreamExecutor().Client(this).Execute<CloseRoomUserStreamResponse, CloseRoomUserStreamResult, CloseRoomUserStreamRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  发送自定义信令给房间
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public SendMessageToRoomResponse SendMessageToRoom(SendMessageToRoomRequest request) {
            return  new SendMessageToRoomExecutor().Client(this).Execute<SendMessageToRoomResponse, SendMessageToRoomResult, SendMessageToRoomRequest>(request);
        }
#else
        /// <summary>
        ///  发送自定义信令给房间
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<SendMessageToRoomResponse> SendMessageToRoom(SendMessageToRoomRequest request) {
            return await new SendMessageToRoomExecutor().Client(this).Execute<SendMessageToRoomResponse, SendMessageToRoomResult, SendMessageToRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询peer对应的用户信息
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeUserByPeerResponse DescribeUserByPeer(DescribeUserByPeerRequest request) {
            return  new DescribeUserByPeerExecutor().Client(this).Execute<DescribeUserByPeerResponse, DescribeUserByPeerResult, DescribeUserByPeerRequest>(request);
        }
#else
        /// <summary>
        ///  查询peer对应的用户信息
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeUserByPeerResponse> DescribeUserByPeer(DescribeUserByPeerRequest request) {
            return await new DescribeUserByPeerExecutor().Client(this).Execute<DescribeUserByPeerResponse, DescribeUserByPeerResult, DescribeUserByPeerRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询房间实时在线人数
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeRoomOnlineUserNumResponse DescribeRoomOnlineUserNum(DescribeRoomOnlineUserNumRequest request) {
            return  new DescribeRoomOnlineUserNumExecutor().Client(this).Execute<DescribeRoomOnlineUserNumResponse, DescribeRoomOnlineUserNumResult, DescribeRoomOnlineUserNumRequest>(request);
        }
#else
        /// <summary>
        ///  查询房间实时在线人数
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeRoomOnlineUserNumResponse> DescribeRoomOnlineUserNum(DescribeRoomOnlineUserNumRequest request) {
            return await new DescribeRoomOnlineUserNumExecutor().Client(this).Execute<DescribeRoomOnlineUserNumResponse, DescribeRoomOnlineUserNumResult, DescribeRoomOnlineUserNumRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  中止混流任务
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public StopMcuTranscodeResponse StopMcuTranscode(StopMcuTranscodeRequest request) {
            return  new StopMcuTranscodeExecutor().Client(this).Execute<StopMcuTranscodeResponse, StopMcuTranscodeResult, StopMcuTranscodeRequest>(request);
        }
#else
        /// <summary>
        ///  中止混流任务
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<StopMcuTranscodeResponse> StopMcuTranscode(StopMcuTranscodeRequest request) {
            return await new StopMcuTranscodeExecutor().Client(this).Execute<StopMcuTranscodeResponse, StopMcuTranscodeResult, StopMcuTranscodeRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  发送自定义信令给房间内的人员
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public PostMessageToUserResponse PostMessageToUser(PostMessageToUserRequest request) {
            return  new PostMessageToUserExecutor().Client(this).Execute<PostMessageToUserResponse, PostMessageToUserResult, PostMessageToUserRequest>(request);
        }
#else
        /// <summary>
        ///  发送自定义信令给房间内的人员
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<PostMessageToUserResponse> PostMessageToUser(PostMessageToUserRequest request) {
            return await new PostMessageToUserExecutor().Client(this).Execute<PostMessageToUserResponse, PostMessageToUserResult, PostMessageToUserRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询用户应用列表信息
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAppsResponse DescribeApps(DescribeAppsRequest request) {
            return  new DescribeAppsExecutor().Client(this).Execute<DescribeAppsResponse, DescribeAppsResult, DescribeAppsRequest>(request);
        }
#else
        /// <summary>
        ///  查询用户应用列表信息
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAppsResponse> DescribeApps(DescribeAppsRequest request) {
            return await new DescribeAppsExecutor().Client(this).Execute<DescribeAppsResponse, DescribeAppsResult, DescribeAppsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteRoomResponse DeleteRoom(DeleteRoomRequest request) {
            return  new DeleteRoomExecutor().Client(this).Execute<DeleteRoomResponse, DeleteRoomResult, DeleteRoomRequest>(request);
        }
#else
        /// <summary>
        ///  删除房间
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteRoomResponse> DeleteRoom(DeleteRoomRequest request) {
            return await new DeleteRoomExecutor().Client(this).Execute<DeleteRoomResponse, DeleteRoomResult, DeleteRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询注册用户列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - startTime[eq] 用户注册时间段开始时间-UTC时间 startTime,endTime同时有值时生效
        ///            - endTime[eq] 用户注册时间段结束时间-UTC时间 startTime,endTime同时有值时生效
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeRegisterUsersResponse DescribeRegisterUsers(DescribeRegisterUsersRequest request) {
            return  new DescribeRegisterUsersExecutor().Client(this).Execute<DescribeRegisterUsersResponse, DescribeRegisterUsersResult, DescribeRegisterUsersRequest>(request);
        }
#else
        /// <summary>
        ///  查询注册用户列表
        /// 允许通过条件过滤查询，支持的过滤字段如下：
        ///            - startTime[eq] 用户注册时间段开始时间-UTC时间 startTime,endTime同时有值时生效
        ///            - endTime[eq] 用户注册时间段结束时间-UTC时间 startTime,endTime同时有值时生效
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeRegisterUsersResponse> DescribeRegisterUsers(DescribeRegisterUsersRequest request) {
            return await new DescribeRegisterUsersExecutor().Client(this).Execute<DescribeRegisterUsersResponse, DescribeRegisterUsersResult, DescribeRegisterUsersRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  发送自定义信令给房间
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public PostMessageToUserRoomResponse PostMessageToUserRoom(PostMessageToUserRoomRequest request) {
            return  new PostMessageToUserRoomExecutor().Client(this).Execute<PostMessageToUserRoomResponse, PostMessageToUserRoomResult, PostMessageToUserRoomRequest>(request);
        }
#else
        /// <summary>
        ///  发送自定义信令给房间
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<PostMessageToUserRoomResponse> PostMessageToUserRoom(PostMessageToUserRoomRequest request) {
            return await new PostMessageToUserRoomExecutor().Client(this).Execute<PostMessageToUserRoomResponse, PostMessageToUserRoomResult, PostMessageToUserRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  移除房间内所有人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RemoveAllUsersByUserRoomIdResponse RemoveAllUsersByUserRoomId(RemoveAllUsersByUserRoomIdRequest request) {
            return  new RemoveAllUsersByUserRoomIdExecutor().Client(this).Execute<RemoveAllUsersByUserRoomIdResponse, RemoveAllUsersByUserRoomIdResult, RemoveAllUsersByUserRoomIdRequest>(request);
        }
#else
        /// <summary>
        ///  移除房间内所有人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RemoveAllUsersByUserRoomIdResponse> RemoveAllUsersByUserRoomId(RemoveAllUsersByUserRoomIdRequest request) {
            return await new RemoveAllUsersByUserRoomIdExecutor().Client(this).Execute<RemoveAllUsersByUserRoomIdResponse, RemoveAllUsersByUserRoomIdResult, RemoveAllUsersByUserRoomIdRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  移除房间内人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RemoveRoomUserResponse RemoveRoomUser(RemoveRoomUserRequest request) {
            return  new RemoveRoomUserExecutor().Client(this).Execute<RemoveRoomUserResponse, RemoveRoomUserResult, RemoveRoomUserRequest>(request);
        }
#else
        /// <summary>
        ///  移除房间内人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RemoveRoomUserResponse> RemoveRoomUser(RemoveRoomUserRequest request) {
            return await new RemoveRoomUserExecutor().Client(this).Execute<RemoveRoomUserResponse, RemoveRoomUserResult, RemoveRoomUserRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  移除房间内人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RemoveUserByUserRoomIdResponse RemoveUserByUserRoomId(RemoveUserByUserRoomIdRequest request) {
            return  new RemoveUserByUserRoomIdExecutor().Client(this).Execute<RemoveUserByUserRoomIdResponse, RemoveUserByUserRoomIdResult, RemoveUserByUserRoomIdRequest>(request);
        }
#else
        /// <summary>
        ///  移除房间内人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RemoveUserByUserRoomIdResponse> RemoveUserByUserRoomId(RemoveUserByUserRoomIdRequest request) {
            return await new RemoveUserByUserRoomIdExecutor().Client(this).Execute<RemoveUserByUserRoomIdResponse, RemoveUserByUserRoomIdResult, RemoveUserByUserRoomIdRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  添加推流规则
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public AddPushStreamRuleResponse AddPushStreamRule(AddPushStreamRuleRequest request) {
            return  new AddPushStreamRuleExecutor().Client(this).Execute<AddPushStreamRuleResponse, AddPushStreamRuleResult, AddPushStreamRuleRequest>(request);
        }
#else
        /// <summary>
        ///  添加推流规则
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<AddPushStreamRuleResponse> AddPushStreamRule(AddPushStreamRuleRequest request) {
            return await new AddPushStreamRuleExecutor().Client(this).Execute<AddPushStreamRuleResponse, AddPushStreamRuleResult, AddPushStreamRuleRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  获取房间信息
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeRoomInfoResponse DescribeRoomInfo(DescribeRoomInfoRequest request) {
            return  new DescribeRoomInfoExecutor().Client(this).Execute<DescribeRoomInfoResponse, DescribeRoomInfoResult, DescribeRoomInfoRequest>(request);
        }
#else
        /// <summary>
        ///  获取房间信息
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeRoomInfoResponse> DescribeRoomInfo(DescribeRoomInfoRequest request) {
            return await new DescribeRoomInfoExecutor().Client(this).Execute<DescribeRoomInfoResponse, DescribeRoomInfoResult, DescribeRoomInfoRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询应用信息:
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAppResponse DescribeApp(DescribeAppRequest request) {
            return  new DescribeAppExecutor().Client(this).Execute<DescribeAppResponse, DescribeAppResult, DescribeAppRequest>(request);
        }
#else
        /// <summary>
        ///  查询应用信息:
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAppResponse> DescribeApp(DescribeAppRequest request) {
            return await new DescribeAppExecutor().Client(this).Execute<DescribeAppResponse, DescribeAppResult, DescribeAppRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  移除房间内所有人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public RemoveAllRoomUsersResponse RemoveAllRoomUsers(RemoveAllRoomUsersRequest request) {
            return  new RemoveAllRoomUsersExecutor().Client(this).Execute<RemoveAllRoomUsersResponse, RemoveAllRoomUsersResult, RemoveAllRoomUsersRequest>(request);
        }
#else
        /// <summary>
        ///  移除房间内所有人员
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<RemoveAllRoomUsersResponse> RemoveAllRoomUsers(RemoveAllRoomUsersRequest request) {
            return await new RemoveAllRoomUsersExecutor().Client(this).Execute<RemoveAllRoomUsersResponse, RemoveAllRoomUsersResult, RemoveAllRoomUsersRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询注册房间号
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeUserRoomResponse DescribeUserRoom(DescribeUserRoomRequest request) {
            return  new DescribeUserRoomExecutor().Client(this).Execute<DescribeUserRoomResponse, DescribeUserRoomResult, DescribeUserRoomRequest>(request);
        }
#else
        /// <summary>
        ///  查询注册房间号
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeUserRoomResponse> DescribeUserRoom(DescribeUserRoomRequest request) {
            return await new DescribeUserRoomExecutor().Client(this).Execute<DescribeUserRoomResponse, DescribeUserRoomResult, DescribeUserRoomRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  创建用户
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateUserResponse CreateUser(CreateUserRequest request) {
            return  new CreateUserExecutor().Client(this).Execute<CreateUserResponse, CreateUserResult, CreateUserRequest>(request);
        }
#else
        /// <summary>
        ///  创建用户
        /// 
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateUserResponse> CreateUser(CreateUserRequest request) {
            return await new CreateUserExecutor().Client(this).Execute<CreateUserResponse, CreateUserResult, CreateUserRequest>(request).ConfigureAwait(false);
        }
#endif

            /// <summary>
            ///  默认OpenjrtcClient 构造器 接口
            ///</summary>
            public interface Builder
            {

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>openjrtcClient 构造器</returns>
                Builder CredentialsProvider(CredentialsProvider provider);

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>openjrtcClient 构造器</returns>
                Builder Environment(Core.Client.SDKEnvironment environment);

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>openjrtcClient 构造器</returns>
                Builder HttpRequestConfig(HttpRequestConfig config);

                /// <summary>
                ///  构造OpenjrtcClient 对象
                ///</summary>
                OpenjrtcClient Build();
            }

            /// <summary>
            ///  默认OpenjrtcClient 构造器
            ///</summary>
            public class DefaultBuilder : Builder
            {
                /// <summary>
                ///  OpenjrtcClient service client
                /// </summary>
                private  OpenjrtcClient openjrtcClient;

                /// <summary>
                ///  默认OpenjrtcClient 构造器构造对象
                ///</summary>
                public DefaultBuilder()
                {
                    openjrtcClient = new OpenjrtcClient();
                }

                /// <summary>
                ///  构造OpenjrtcClient 对象
                ///</summary>
                public OpenjrtcClient Build()
                {
                    if (openjrtcClient.CredentialsProvider == null)
                    {
                        //if credentialsProvider not set, try load jdcloud global default  credentials provider
                        openjrtcClient.credentialsProvider = JdCloud.DefaultInstance.GetCredentialsProvider();
                        if (openjrtcClient.credentialsProvider == null)
                        {
                            throw new ArgumentNullException("OpenjrtcClient build error: jdcloud credentials provider not set");
                        }
                    }
                    if (openjrtcClient.HttpRequestConfig == null)
                    {
                        openjrtcClient.httpRequestConfig = JdCloud.DefaultInstance.GetHttpRequestConfig();
                        if (openjrtcClient.httpRequestConfig == null)
                        {
                        throw new ArgumentNullException("OpenjrtcClient build error: http request config not set");
                        }
                    }
                    return openjrtcClient;
                }

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>openjrtcClient 构造器</returns>
                public Builder CredentialsProvider(CredentialsProvider provider)
                {
                    openjrtcClient.credentialsProvider = provider;
                    return this;
                }

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>openjrtcClient 构造器</returns>
                public Builder Environment(SDKEnvironment environment)
                {
                    openjrtcClient.environment = environment;
                    return this;
                }

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>openjrtcClient 构造器</returns>
                public Builder HttpRequestConfig(HttpRequestConfig config)
                {
                    openjrtcClient.httpRequestConfig = config;
                    return this;
                }
            }
    }
}
